package cn.taoticket.service;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


import cn.taoticket.mapper.TaoticketSchedulerSeatMapper;
import cn.taoticket.pojo.TaoticketSchedulerSeat;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by taoticket
 */
@RestController
public class RestTaoticketSchedulerSeatService {

    @Resource
     private TaoticketSchedulerSeatMapper taoticketSchedulerSeatMapper;

     @RequestMapping(value = "/getTaoticketSchedulerSeatById",method = RequestMethod.POST)
     public TaoticketSchedulerSeat getTaoticketSchedulerSeatById(@RequestParam("id") Long id)throws Exception{
        return taoticketSchedulerSeatMapper.getTaoticketSchedulerSeatById(id);
     }

     @RequestMapping(value = "/getTaoticketSchedulerSeatListByMap",method = RequestMethod.POST)
     public List<TaoticketSchedulerSeat>	getTaoticketSchedulerSeatListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketSchedulerSeatMapper.getTaoticketSchedulerSeatListByMap(param);
     }

     @RequestMapping(value = "/getTaoticketSchedulerSeatCountByMap",method = RequestMethod.POST)
     public Integer getTaoticketSchedulerSeatCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketSchedulerSeatMapper.getTaoticketSchedulerSeatCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddTaoticketSchedulerSeat",method = RequestMethod.POST)
     public Integer qdtxAddTaoticketSchedulerSeat(@RequestBody TaoticketSchedulerSeat taoticketSchedulerSeat)throws Exception{
        taoticketSchedulerSeat.setCreatedTime(new Date());
        return taoticketSchedulerSeatMapper.insertTaoticketSchedulerSeat(taoticketSchedulerSeat);
     }

     @RequestMapping(value = "/qdtxModifyTaoticketSchedulerSeat",method = RequestMethod.POST)
     public Integer qdtxModifyTaoticketSchedulerSeat(@RequestBody TaoticketSchedulerSeat taoticketSchedulerSeat)throws Exception{
        taoticketSchedulerSeat.setUpdatedTime(new Date());
        return taoticketSchedulerSeatMapper.updateTaoticketSchedulerSeat(taoticketSchedulerSeat);
     }

    @RequestMapping(value = "/getTaoticketSchedulerSeatByOrder", method = RequestMethod.POST)
    public TaoticketSchedulerSeat getTaoticketSchedulerSeatByOrder(@RequestParam("scheduleId") Long scheduleId,
                                                                   @RequestParam("seatX") Integer seatX,
                                                                   @RequestParam("seatY") Integer seatY) throws Exception{
         return taoticketSchedulerSeatMapper.getTaoticketSchedulerSeatByOrder(scheduleId,seatX,seatY);
    }
}
